<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MasterDetailControl.ascx.cs" Inherits="Northwind.Web.Controls.MasterDetailControl" %>

<h3>Master Detail</h3>

<div style="font-weight:bold; font-size:16px;">Categories:</div>

<asp:GridView ID="grid" CellPadding="3" ShowFooter="false" AutoGenerateColumns="false" OnRowCommand="grid_OnRowCommand" runat="server">
    <Columns>
        <asp:CommandField ButtonType="Link" SelectText="Select" ShowSelectButton="true" />
        <asp:BoundField DataField="CategoryID" HeaderText="ID" />
        <asp:BoundField DataField="CategoryName" HeaderText="Name" />
        <asp:BoundField DataField="Description" HeaderText="Description" />        
    </Columns>
</asp:GridView>

<br />

<asp:Panel ID="detailPanel" Visible="false" runat="server">
        
    <div style="font-weight:bold; font-size:16px;">Category Detail:</div>
    
    <table>
        <tr>
            <td>ID:</td>
            <td><asp:Label ID="idLabel" runat="server"></asp:Label></td>
        </tr>
        <tr>
            <td>Name:</td>
            <td><asp:Label ID="nameLabel" runat="server"></asp:Label></td>
        </tr>
        <tr>
            <td>Description:</td>
            <td><asp:Label ID="descriptionLabel" runat="server"></asp:Label></td>
        </tr>
    </table>
    
</asp:Panel>